package com.project.psc.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.psc.bean.BiddConfirmBean;
import com.project.psc.dto.SupplierDto;
import com.project.psc.service.IBiddConfirmService;
import com.project.psc.util.SupplierThreadLocal;
import com.project.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("biddConfirm")
public class BiddConfirmController {
    @Autowired
    private IBiddConfirmService biddConfirmService;
    @GetMapping("cutByItem")

    public ResultVo cutByItem(Integer pageNO, String title, String pact) {
        SupplierDto loginUser = SupplierThreadLocal.getSupplier();
        IPage<BiddConfirmBean> biddConfirmBeanIPage = biddConfirmService.cutByItem(pageNO, loginUser.getId(), title, pact);
        return ResultVo.ok(biddConfirmBeanIPage);
    }
    @GetMapping("findById")
    public ResultVo findById(Long id){
        BiddConfirmBean byId = biddConfirmService.findById(id);
        return ResultVo.ok(byId);
    }

}
